{% extends "base.django.html" %}
{% block head_title %}Album{% endblock %}

{% block body_content %}
<div id='album_title'>
	<h1>Album</h1>
</div>

<div id='album'>
	<img id='album_cover' src='
		{% if album.cover.get_image_thumbnail_url %}
			{{ album.cover.get_image_thumbnail_url }}
		{% else %}
			/shell/media/img/app/default_album_cover.jpg
		{% endif %}
	'/>
	<p id='album_title'>{{ album.title }} <span class='small'>Album created {{ album.date_create|timesince }} ago.</span></p>
	<p id='album_description'>{{ album.description }}</p>
	{% if user.is_authenticated %}
		<a href='{% url album-edit album.id %}'><img class='icon' src='/shell/media/img/app/edit.png'/> Edit</a>
		<a href='{% url album-delete album.id %}'><img class='icon' src='/shell/media/img/app/delete.png'/> Delete</a>
	{% endif %}
	<div class='clear'></div>
</div>

<div id='album_photo'>
	{% for p in album.photos.all %}
		{% ifnotequal p.id photo.id %}
			<a class='thumbnail' href='{{ p.get_absolute_url }}'><img class='thumbnail' src='{{ p.get_image_thumbnail_url }}' title='{{ p.caption }}'/></a> 
		{% else %}
			<img class='currentphoto' src='{{ p.get_image_thumbnail_url }}'/>
		{% endifnotequal %}
	{% endfor %}
	{% if user.is_authenticated %}
		<a class='thumbnail' href='{% url album-photo-add album.id %}'><img class='thumbnail' src='/shell/media/img/app/add.png'/></a>
	{% endif %}
</div>


{% endblock %}